from flask import Flask, jsonify
from handle.analyse_data import *
from flask_cors import CORS

app = Flask(__name__)
CORS(app, resources=r"/*")


@app.route('/')
def hello_world():  # put application's code here
    return 'Hello World!'


@app.route('/line', methods=['POST'])
def line():
    return jsonify(data_line())


@app.route('/sunburst', methods=['POST'])
def sunburst():
    return jsonify(data_sunburst())


@app.route('/sankey', methods=['POST'])
def sankey():
    return jsonify(data_sankey())


@app.route('/bar', methods=['POST'])
def bar():
    return jsonify(data_bar())


@app.route('/wordCloud', methods=['POST'])
def word_cloud():
    return jsonify(data_word_cloud())


if __name__ == '__main__':
    app.run()
